package com.ag.lzm.action;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.ag.bean.TbPlan;
import com.ag.common.AjaxNotify;
import com.ag.common.BaseAction;
import com.ag.lzm.service.IPlanStandardService;

/**
 * 预案启动标准  包括匹配预案等操作均在此Action进行
 * 
 * @author 黎肇明
 * 
 */
@Scope("prototype")
@Controller("PlanStandardAction")
public class PlanStandardAction extends BaseAction {
	private static final long serialVersionUID = 6429962710279498662L;
	@Resource(name = "LZMPlanStandardServiceImpl")
	private IPlanStandardService planStandardService;
	/**
	 * 当前应急事件ID
	 */
	private String eventID;
	public String getEventID() {
		return eventID;
	}

	private String ajaxRst;

	private List<TbPlan> planList;

	public List<TbPlan> getPlanList() {
		return planList;
	}

	public String getAjaxRst() {
		return ajaxRst;
	}

	private String planID;

	public String getPlanID() {
		return planID;
	}

	public void setEventID(String eventID) {
		this.eventID = eventID;
	}

	/**
	 * 匹配预案
	 * 
	 * @return
	 */
	public String findMatchPlan() {
		try {
			planList = planStandardService.matchPlan(eventID);
			ajaxRst = AjaxNotify.SUCCESS;
			return "match_plan";
		} catch (Exception e) {
			e.printStackTrace();
			ajaxRst = AjaxNotify.EXCEPTION;
			return "operate";
		}
	}
	
	/**
	 * 转向jsp
	 * 
	 * @return
	 */
	public String matchPlan() {
		return "red_match_plan";
	}

}
